<template>
  <el-drawer v-model="dialogVisible" title="面试记录" size="80%">
    <el-table :data="tableData" row-key="id" height="100%" stripe>
      <el-table-column prop="round" label="面试轮次" fixed="left" />
      <el-table-column prop="user.real_name" label="面试官" fixed="left" />
      <el-table-column prop="result_text" label="面试结果" fixed="left" />
      <el-table-column prop="evaluate" label="评价" show-overflow-tooltip />
      <el-table-column prop="interview_time" label="面试时间" />
      <el-table-column label="操作" fixed="right" width="300">
        <template #default="scope">
          <el-button
            type="primary"
            link
            icon="Edit"
            @click="handleInfo(scope.row.id)"
            v-auth="'interview_edit'"
          >
            评价
          </el-button>
          <el-button
            type="danger"
            link
            icon="DeleteFilled"
            @click="delInfo(scope.row.id)"
            v-auth="'interview_del'"
          >
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-drawer>
</template>

<script setup lang="ts">
import { logApi } from "@/api/company/interview";
import { ref } from "vue";
const dialogVisible = ref(false);
const view_id = ref(0);
const tableData = ref([]);

function getTableInfo() {
  logApi(view_id.value).then((res) => {
    tableData.value = res.data;
  });
}
const dialogOpen = (id: number) => {
  dialogVisible.value = true;
  view_id.value = id;
  getTableInfo();
};
defineExpose({
  dialogOpen,
});
</script>

<style lang="scss">
.el-form-item {
  margin-bottom: 10px;
}
.el-select {
  width: 200px;
}
.upload-demo {
  .el-icon svg {
    height: 3em;
    width: 3em;
  }
}
</style>

<style lang="scss" scoped></style>
